package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.ViolationCategoryMapper;
import com.ruoyi.business.domain.ViolationCategory;
import com.ruoyi.business.service.IViolationCategoryService;

/**
 * 违规类目Service业务层处理
 * 
 * @author lcz
 * @date 2025-01-19
 */
@Service
public class ViolationCategoryServiceImpl implements IViolationCategoryService 
{
    @Autowired
    private ViolationCategoryMapper violationCategoryMapper;

    /**
     * 查询违规类目
     * 
     * @param id 违规类目主键
     * @return 违规类目
     */
    @Override
    public ViolationCategory selectViolationCategoryById(Long id)
    {
        return violationCategoryMapper.selectViolationCategoryById(id);
    }

    /**
     * 查询违规类目列表
     * 
     * @param violationCategory 违规类目
     * @return 违规类目
     */
    @Override
    public List<ViolationCategory> selectViolationCategoryList(ViolationCategory violationCategory)
    {
        return violationCategoryMapper.selectViolationCategoryList(violationCategory);
    }

    /**
     * 新增违规类目
     * 
     * @param violationCategory 违规类目
     * @return 结果
     */
    @Override
    public int insertViolationCategory(ViolationCategory violationCategory)
    {
        violationCategory.setCreateTime(DateUtils.getNowDate());
        return violationCategoryMapper.insertViolationCategory(violationCategory);
    }

    /**
     * 修改违规类目
     * 
     * @param violationCategory 违规类目
     * @return 结果
     */
    @Override
    public int updateViolationCategory(ViolationCategory violationCategory)
    {
        violationCategory.setUpdateTime(DateUtils.getNowDate());
        return violationCategoryMapper.updateViolationCategory(violationCategory);
    }

    /**
     * 批量删除违规类目
     * 
     * @param ids 需要删除的违规类目主键
     * @return 结果
     */
    @Override
    public int deleteViolationCategoryByIds(Long[] ids)
    {
        return violationCategoryMapper.deleteViolationCategoryByIds(ids);
    }

    /**
     * 删除违规类目信息
     * 
     * @param id 违规类目主键
     * @return 结果
     */
    @Override
    public int deleteViolationCategoryById(Long id)
    {
        return violationCategoryMapper.deleteViolationCategoryById(id);
    }
}
